﻿

<form nz-form #articleCreateOrEditForm="ngForm" (ngSubmit)="save()" autocomplete="off">
    <fieldset>
            <nz-form-item nz-row>
                <nz-form-label [nzSm]="4" nzFor="TitleInput" nzRequired>
                    文章标题
                </nz-form-label>
                <nz-form-control [nzSm]="20" nzHasFeedback>
                    <input nz-input #titleInput="ngModel" name="Title" [(ngModel)]="article.title"
                           placeholder="请输入文章标题" required maxlength="50">
                    <nz-form-explain *ngIf="titleInput.dirty && titleInput.errors">
                        <validation-messages [formCtrl]="titleInput"></validation-messages>
                    </nz-form-explain>
                </nz-form-control>
            </nz-form-item>
            <nz-form-item nz-row>
                <nz-form-label [nzSm]="4" nzFor="ContentInput" >
                    文章内容
                </nz-form-label>
                <nz-form-control [nzSm]="20" nzHasFeedback>
                    <!-- <input nz-input #contentInput="ngModel" name="Content" [(ngModel)]="article.content"
                           placeholder="请输入文章内容">
                    <nz-form-explain *ngIf="contentInput.dirty && contentInput.errors">
                        <validation-messages [formCtrl]="contentInput"></validation-messages>
                    </nz-form-explain> -->

                    <ckeditor [editor]="Editor" [config]="config" data="<p>Hello, world!</p>"></ckeditor>
                </nz-form-control>
            </nz-form-item>
    </fieldset>

    <div class="modal-footer">
        <button nz-button [nzType]="'default'" type="button" (click)="close()" [disabled]="saving">
            {{"Cancel" | localize}}
        </button>
        <button nz-button [nzType]="'primary'" type="submit" [disabled]="!articleCreateOrEditForm.form.valid|| saving"
                [nzLoading]="saving">
            <i nz-icon type="save" *ngIf="!saving"></i> {{"Save" | localize}}
        </button>
    </div>
</form>
